package com.storm.future.red.common;

import com.storm.future.annotation.NoAttack;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author gu
 * @date 2020/3/16 17:08
 */
@Component
@NoAttack
@PropertySource("red/common/soldier.properties")
public class EngineerSoldier implements Soldier {

    @Value("${engineer.attack}")
    private int attackPower;

    @Override
    public void attack(Unit unit) {
        System.out.println("工程师的攻击力是："+attackPower);
        System.out.println("它们不会攻击人");
    }

    @Override
    public String toString() {
        return "EngineerSoldier{" +
                "attackPower=" + attackPower +
                '}';
    }
}
